home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Shareware
/
IDimager Personal 4.2.0.3
/
setup_IDimager_Personal_V4.exe
/
{app}
/
web
/
modules
/
search.psc
< prev
next >
Wrap
Text File
|
2008-06-27
|
3KB
|
100 lines
%code
%include publicfunctions.inc %/include
var
AText: WideString;
AProps, ASubs: TCatalogItemProps;
AColls, ASubColls: TImageCollections;
i, j: Integer;
ASg: TSearchGroup;
begin
result := toWideString('');
AText := Utf8Decode(Request.Params.Values['text']);
if AText = '' then
AText := Request.Params.Values['text'];
if AText = '' then
begin
result := result + 'no search text specified';
exit;
end;
if Request.Params.Values['labels'] = 'y' then
begin
result := result + '<p>';
AProps := TCatalogItemProps.Create(TCatalogItemProp, '');
//Catalog.FindPropsByName (AText, AProps, '', ssAnyPosition, True, -1, True);
ASg := TSearchGroup.Create(nil);
ASg.BuildFromText (AText, '');
for i := 0 to ASg.Items.Count - 1 do
begin
ASubs := TCatalogItemProps.Create(TCatalogItemProp, '');
Catalog.FindPropsByName (ASg.Items.Items[i].SearchValue, ASubs, '', ASg.Items.Items[i].SearchStyle, True, -1, True);
for j := 0 to ASubs.Count - 1 do
ASubs.Items[j].CopyTo (AProps, False);
ASubs.Free;
end;
ASg.Free;
Catalog.PathNameForProps (AProps, ' :: ', True);
AProps.Sort('PropName', stAscending);
if AProps.Count > 0 then
begin
for i := 0 to AProps.Count - 1 do
begin
result := result + '<a href="javascript:getHTML(''%var:PageOffset/./modules/labelimages.psc'', ''' + AjaxContainer + ''', ''GUID=' + AProps.Items[i].GUID + ''')">';
result := result + AProps.Items[i].Text;
result := result + '</a><br/>';
end;
end
else
result := result + 'no catalog labels found for ' + AText;
AProps.Free;
result := result + '</p>';
end;
if Request.Params.Values['albums'] = 'y' then
begin
result := result + '<p>';
AColls := TImageCollections.Create(TImageCollection, '');
ASg := TSearchGroup.Create(nil);
ASg.BuildFromText (AText, '');
for i := 0 to ASg.Items.Count - 1 do
begin
ASubColls := TImageCollections.Create(TImageCollection, '');
Catalog.FindCollectionsByName (ASg.Items.Items[i].SearchValue, AColls, ASg.Items.Items[i].SearchStyle);
for j := 0 to ASubColls.Count - 1 do
ASubColls.Items[j].CopyTo (AColls, False);
ASubColls.Free;
end;
ASg.Free;
AColls.Sort('CollectionName', stAscending);
if AColls.Count > 0 then
begin
for i := 0 to AColls.Count - 1 do
begin
AColls.Items[i].Text := Catalog.PathNameForCollection (AColls.Items[i], ' :: ');
result := result + '<a href="javascript:getHTML(''%var:PageOffset/./modules/collimages.psc'', ''' + AjaxContainer + ''', ''GUID=' + AColls.Items[i].GUID + ''')">';
result := result + AColls.Items[i].Text;
result := result + '</a><br/>';
end;
end
else
result := result + 'no portfolio collections found for ' + AText;
AColls.Free;
result := result + '</p>';
end;
end;
%/code